package com.gma.userprofile.info.social

import com.gma.userprofile.util.{HBaseUtil, SparkUtil}
import org.apache.spark.sql.DataFrame

object UserProfileAddress {
  def main(args: Array[String]): Unit = {
    //获取分区参数
    val ds = args.head
    //获取spark环境
    val spark = SparkUtil.getSparkSession

    //提取地址标签
    val addressTag: DataFrame = spark.sql(
      s"""
        |select
        |id,
        |address_default_id as address
        |from
        |dim.dim_pub_user_info_d_f
        |where ds='$ds'
        |
        |""".stripMargin)

    //将标签保存到habse
    HBaseUtil.tagToHBase(addressTag, "address")
  }

}
